package com.jx.springcloud.controller;

import com.jx.springcloud.entiy.CommentResult;
import com.jx.springcloud.entiy.User;
import com.jx.springcloud.service.FeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class FeignControl {
    @Resource
    private FeignService feignService;

    @GetMapping(value = "/feignConsumer/getUser/{id}")
    public CommentResult<User> getUser(@PathVariable("id") Long id){
        return feignService.getUser(id);
    }

    @GetMapping(value = "/feignConsumer/getTimeout")
    public String getTimeout(){
        return feignService.getPortTimeout();
    }
}
